#include <linux/sched.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <wait.h>

int main(){
	pid_t pid = fork();
	if(pid < 0) {
		fprintf(stderr, "Fork Failed");
	}
	else if(pid == 0) {
		printf("son pid = %d\n",getpid());
		for(int i = 1; i <= 5; ++ i) {
			printf("son -- %d\n",i);
			sleep(1);
		}
		printf("son over!\n");
	}
	else {
		printf("parent pid = %d\n",getpid());
		for(int i=1;i<=10;++i)sleep(100);
	}
	return 0;
}

